'use strict';

/**
 * Route configuration for the NxtMap module.
 */
angular.module('JiangGanApp').config(['$stateProvider', '$urlRouterProvider',
    function($stateProvider, $urlRouterProvider) {

        // For unmatched routes
        $urlRouterProvider.otherwise('/login');
        $urlRouterProvider.when("/app/netbar", "/app/netbar/main");
        // Application routes
        $stateProvider
            .state('login', {  //登录界面
                url: '/login',
                templateUrl: 'templates/others/login.html',
                controller: 'LoginCtrl'
            })           
            .state('app', {  //main主页
                url: '/app',
                templateUrl: 'templates/main.html'
            })
            .state('app.netbar',{
                url:'/netbar',
                template:'<div ui-view class="main-class"></div>'
            })
            .state('app.netbar.main', {  //网吧
                url: '/main',
                templateUrl: 'templates/netbar/netbar.html',
                controller:'NetbarCtrl'
            })
            .state('app.netbar.detail', {  //网吧
                url: '/detail:id',
                templateUrl: 'templates/netbar/netbar-detail.html'
            })
            .state('app.netbar.detail.info', {  //网吧
                url: '/info',
                templateUrl: 'templates/netbar/netbar-info.html',
                controller:'NetbarInfoCtrl'
            })
            .state('app.netbar.detail.relatedPer',{
                url:'/relatedPer',
                templateUrl:'templates/netbar/relatedPer.html',
                controller:'RelatedPerCtrl'
            })
            .state('app.criminals', {  //前科
                url: '/criminals',
                templateUrl: 'templates/qianke/qianke.html',
                controller:'QianKeCtrl'
            })
            .state('app.criminalsinfo', {  //前科
                url: '/criminalsinfo',
                templateUrl: 'templates/qianke/qianke-info.html',
                controller:'QianKeInfoCtrl'
            })
            .state('app.netbar.detail.pertrack',{
                url: '/pertrack',
                templateUrl: 'templates/netbar/track.html',
                controller:'TrackPerCtrl'
            })
            .state('app.netbar.detail.aspect',{
                url: '/aspect',
                templateUrl: 'templates/netbar/aspect.html',
                controller:'NetbarCtrl'
            })

    }
]);